export default class EffectsBase extends Laya.Script3D {

    destroyTime: number = 0;
    IsUpdateTimeDestroy: boolean = true;
    Init(DesTime: number, Des: boolean = true) {
        this.destroyTime = DesTime;
        this.IsUpdateTimeDestroy = Des;
    }
    onUpdate() {
        if (!this.IsUpdateTimeDestroy) return;
        this.destroyTime -= (Laya.timer.delta / 1000);
        if (this.destroyTime <= 0) {
            this.owner.destroy();
        }
    }
    RemoveSelf() {
        console.log("删除建筑特效");
        if (this.owner != null && !this.owner.destroyed) {
            this.owner.destroy();
        }
    }
}